cc = sw5cc  -host 
cc_slave = sw5cc -slave 

SCHEDULER_INSTALL_PATH=${DAG_HOME}/dag_task_scheduler

DEBUG = -DCHECK #-g
OPT = -O3 #0 -g #-O3 -std=gnu99

EXTRA_FLAGS= -D_N=4096 -D_M=4096 -D_P=4096 -D_TS=128 -DTASK_BSIZE_1=32 #-DMMEM
LIBFLAGS =  -L${SCHEDULER_INSTALL_PATH}/lib -ldag_task_scheduler -lstdc++ -lm -lswperf

CFLAGS = $(DEBUG) $(OPT) $(EXTRA_FLAGS) -Wall -I${SCHEDULER_INSTALL_PATH}/include 
 
dag:matmul_dag_master.o matmul_dag_slave.o
	$(cc_slave) -hybrid   $(CFLAGS)  -o matmul_dag matmul_dag_master.o matmul_dag_slave.o $(LIBFLAGS)
matmul_dag_master.o: matmul_dag_master.c	
	$(cc) $(CFLAGS) -c  matmul_dag_master.c  $(LIBFLAGS)
matmul_dag_slave.o: matmul_dag_slave.c
	$(cc_slave) $(CFLAGS)  -c matmul_dag_slave.c  $(LIBFLAGS)


clean:
	@rm -f *.o  matmul_dag
	@echo Cleaning current directory 
clean_all:
	@rm -f *.o *.txt *.log tmp matmul_dag
	@echo Cleaning current directory
